package com.util;


import java.awt.image.BufferedImage;

public class IsDark {
    public static boolean getRGB(BufferedImage image,int x,int y){
        int[] rgb = new int [3];
        int pixel = image.getRGB(x, y);
        rgb[0] = (pixel & 0xff0000) >> 16;
        rgb[1] = (pixel & 0xff00) >> 8;
        rgb[2] = (pixel & 0xff);
        if (rgb[0]*0.299 + rgb[1]*0.578 + rgb[2]*0.114 >= 192){
            return false;
        }else {
            return true;
        }

    }
}
